package commConfig

import (
	"encoding/json"
	"gitee.com/fierce_wolf/go-fox-edge-common/commUtil/FileName"
	"os"
)

type InitialConfigFile struct {
}

func (e *InitialConfigFile) ReadConfigFile(filePath string) (map[string]interface{}, error) {
	filePath = FileName.GetOsFilePath(filePath)

	jsn, err := os.ReadFile(filePath)
	if err != nil {
		return nil, err
	}

	var data map[string]interface{}
	err = json.Unmarshal([]byte(jsn), &data)
	if err != nil {
		return nil, err
	}

	return data, nil
}
